﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace BlockMix.GamePanels
{
    /// <summary>
    /// Interaction logic for MenuPanel.xaml
    /// </summary>
    public partial class MenuPanel : UserControl
    {

        internal enum MenuOption
        {
            SinglePlayer = 1,
            Battle = 2,
            Settings = 3,
            Quit = 4
        }

        internal delegate void MenuHandler(MenuPanel sender, MenuOption option);

        internal event MenuHandler MenuClicked;

        public MenuPanel()
        {
            InitializeComponent();
        }

        #region Methods

        private void RaiseMenuOption(MenuOption option)
        {
            if (MenuClicked == null) return;
            MenuClicked(this, option);
        }

        #endregion

        #region Event Handlers

        private void menuSinglePlayer_Click(object sender, RoutedEventArgs e)
        {
            RaiseMenuOption(MenuOption.SinglePlayer);
        }

        private void menuBattle_Click(object sender, RoutedEventArgs e)
        {
            RaiseMenuOption(MenuOption.Battle);
        }

        private void menuSettings_Click(object sender, RoutedEventArgs e)
        {
            RaiseMenuOption(MenuOption.Settings);
        }

        private void menuQuit_Click(object sender, RoutedEventArgs e)
        {
            RaiseMenuOption(MenuOption.Quit);
        }

        #endregion

    }
}
